import JuejinBody from '@/components/juejinBody.vue'
import JuejinEntryList from '@/components/juejinEntryList.vue'
import JuejinBots from '@/components/BOTPage.vue'
import UserAct from '@/components/UserAct.vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/juejin',
    },
    {
      redirect: '/recommended',
      name: 'JuejinBody',
      path: '/juejin',
      component: JuejinBody,
      children: [
        {
          name: 'following',
          path: '/following',
          component: JuejinEntryList,
        },
        {
          name: 'recommended',
          path: '/recommended',
          component: JuejinEntryList,
        },
        {
          name: 'backend',
          path: '/backend',
          component: JuejinEntryList,
        },
        {
          name: 'frontend',
          path: '/frontend',
          component: JuejinEntryList,
        },
        {
          name: 'android',
          path: '/android',
          component: JuejinEntryList,
        },
        {
          name: 'ios',
          path: '/ios',
          component: JuejinEntryList,
        },
        {
          name: 'ai',
          path: '/ai',
          component: JuejinEntryList,
        },
        {
          name: 'freebie',
          path: '/freebie',
          component: JuejinEntryList,
        },
        {
          name: 'career',
          path: '/career',
          component: JuejinEntryList,
        },
        {
          name: 'article',
          path: '/article',
          component: JuejinEntryList,
        },
      ],
    },
    {
      redirect: 'tj',
      name: 'JuejinBot',
      path: '/bots',
      component: JuejinBots,
      children: [
        {
          name: 'tj',
          path: '/tj',
          component: UserAct,
        },
        {
          name: 'xlgj',
          path: '/xlgj',
          component: UserAct,
        },
        {
          name: 'syfw',
          path: '/syfw',
          component: UserAct,
        },
        {
          name: 'wbcz',
          path: '/wbcz',
          component: UserAct,
        },
        {
          name: 'xxjy',
          path: '/xxjy',
          component: UserAct,
        },
        {
          name: 'dmzs',
          path: '/dmzs',
          component: UserAct,
        },
        {
          name: 'shfs',
          path: '/shfs',
          component: UserAct,
        },
        {
          name: 'yx',
          path: '/yx',
          component: UserAct,
        },
        {
          name: 'txyyspjs',
          path: '/txyyspjs',
          component: UserAct,
        },
      ],
    },
  ],
})

export default router
